package com.cph.usercenter.controller;

import com.cph.usercenter.dao.user.UserMapper;
import com.cph.usercenter.domain.entity.user.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.xml.ws.Action;
import java.util.Date;

/**
 * @ClassName TsetController
 * @Description TODO
 * @Author cph
 * @Date 2020/9/25 15:28
 * @Version 1.0
 */
@RestController
public class TestController {

    @Autowired
    private UserMapper mapper;

    @GetMapping("/test")
    public User insert(){
        User user = new User();
        user.setAvatarUrl("XXX");
        user.setBonus(100);
        user.setCreateTime(new Date());
        user.setUpdateTime(new Date());
        mapper.insert(user);
        return user;
    }
}
